<template>
  <div>
    <!-- <router-link to="/">home</router-link>
    <router-link to="/about">about</router-link> -->
    <div class="nav-wrap">
      <div class="nav-left">
        <!--          <div class="nav-item nav-item-left"></div>-->
        <div class="nav-item nav-item-left">
          {{ hcDate }}&nbsp;&nbsp;&nbsp;&nbsp;<span>安全天数：</span>{{ safeDays }}<span>天</span>
        </div>
        <!-- <router-link class="nav-item nav-item-left" to="/">
          <div>首页</div>
        </router-link> -->
        <!-- <router-link class="nav-item nav-item-left">
          <div>视频检测</div>
        </router-link>
        <router-link class="nav-item nav-item-left">
          <div>卫星云图</div>
        </router-link>
        <router-link class="nav-item nav-item-left">
          <div>声纳检测</div>
        </router-link> -->
      </div>
      <div class="nav-middle">大唐哈尔滨第一热电厂指标管控平台</div>
      <div class="nav-right">
        <!-- <router-link class="nav-item nav-item-left">
          <div>拉力监测</div>
        </router-link>
        <router-link class="nav-item nav-item-left">
          <div>水质生物</div>
        </router-link>
        <div class="nav-item nav-item-right">系统管理</div>-->
        <div class="nav-item nav-item-right">
          安全是最大的政治&nbsp;&nbsp;安全是企业最大的效益&nbsp;&nbsp;安全是职工最大的福利
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { dayjs } from 'element-plus'
export default {
  name: 'SppHeader',
  props: {
    data: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      hcDate: dayjs().format('YYYY-MM-DD HH:mm:ss'),
      safeDays: 0
    }
  },
  watch: {
    data(newValue) {
      this.safeDays = Math.floor(newValue.M0_yxts)
    }
  },
  mounted() {
    this.getNowTime()
  },
  methods: {
    getNowTime() {
      const self = this
      this.hcDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
      let speed = 1000
      let theNowTime = function () {
        self.hcDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
      }
      setInterval(theNowTime, speed)
    }
  }
}
</script>
<style lang="scss" scoped>
.nav-wrap {
  display: flex;
  justify-content: space-between;
  //   align-items: center;
  width: 100%;
  height: 90px;
  padding: 16px 0 0 0;
  background-image: url('@/assets/spp/u1.png');
  background-size: 100% 100%;
  background-position: center center;
  color: #fff;
  .nav-item {
    flex: 1;
    height: 40px;
    text-align: center;
    line-height: 40px;
    font-size: 18px;
    span {
      letter-spacing: 3px;
    }
  }
  .nav-item-right {
    background-image: url('@/assets/spp/u4.png');
    background-size: 100% 100%;
    background-position: center center;
    color: #ff0000;
    font-size: 17px;
    font-weight: bold;
  }
  .nav-item-left {
    background-image: url('@/assets/spp/u14.png');
    background-size: 100% 100%;
    background-position: center center;
    margin-left: -14px;

    color: #ff0000;
    font-weight: bold;
  }
  .nav-middle {
    font-size: 19px;
    font-weight: 700;
    color: #00f0ff;
  }
  .nav-left,
  .nav-right {
    display: flex;
    width: 34%;
    justify-content: space-between;
    align-items: center;
  }
  .nav-right {
    width: 35%;
  }
}
</style>
